home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
smaltalk
/
manchest.lha
/
MANCHESTER
/
manchester
/
2.3
/
Form-fixes.st
< prev
next >
Wrap
Text File
|
1993-07-24
|
2KB
|
48 lines
" NAME Form-fixes
AUTHOR manchester
FUNCTION ?
ST-VERSION 2.3
PREREQUISITES
CONFLICTS
DISTRIBUTION world
VERSION 1
DATE 22 Jan 1989"
'From Smalltalk-80, Version 2.3 of 13 June 1988 on 21 July 1989 at 12:18:55 pm'!
!InfiniteForm methodsFor: 'displaying'!
displayOn: aDisplayMedium at: aDisplayPoint clippingBox: clipRectangle rule: ruleInteger mask: aForm
"Display the receiver on the display medium aDisplayMedium positioned at aDisplayPoint within
the rectangle clipRectangle and with the rule, ruleInteger, and mask, aForm. Bugs fixed so that aDisplayPoint
is taken into account, and infinite opaque forms work."
| targetBox patternBox |
(aForm == Form black and: [patternForm class == Form and: [patternForm extent = (16 @ 16)]])
ifTrue:
["Use patternForm as a mask for BitBlt"
aDisplayMedium fill: clipRectangle rule: ruleInteger mask: (patternForm wrapAround: aDisplayPoint)]
ifFalse:
["Do it iteratively"
targetBox _ aDisplayMedium boundingBox intersect: clipRectangle.
patternBox _ patternForm boundingBox.
(targetBox left truncateTo: patternBox width) + (aDisplayPoint x \\ patternBox width) - patternBox width to: targetBox right - 1 by: patternBox width do:
[:x |
(targetBox top truncateTo: patternBox height) + (aDisplayPoint y \\ patternBox height) - patternBox height to: targetBox bottom - 1 by: patternBox height do:
[:y |
patternForm displayOn: aDisplayMedium
at: x @ y
clippingBox: clipRectangle
rule: ruleInteger
mask: aForm]]]!
!OpaqueForm class methodsFor: 'instance creation'!
shape: aSolidForm
"Answer a new instance of the receiver that is black where aSolidForm is black
and transparent where aSolidForm is white."
^ self new setFigure: aSolidForm deepCopy shape: aSolidForm! !